﻿@using System.Text.Encodings.Web
@using Abp.Extensions
@using MyCompanyName.AbpZeroTemplate.Web.Views.Shared.Components.AccountLanguages
@model LanguageSelectionViewModel
@if (Model.Languages.Count > 1)
{
    <div class="language-switch-area">
        @foreach (var languageInfo in Model.Languages)
        {
            <a href="~/AbpLocalization/ChangeCulture?cultureName=@(languageInfo.Name)&returnUrl=@(ApplicationPath)@(UrlEncoder.Default.Encode(Context.Request.Path.Value.RemovePreFix("/") + Context.Request.QueryString))">
                <span class="language-icon @(languageInfo.Name == Model.CurrentLanguage.Name ? "language-icon-current" : "")" title="@languageInfo.DisplayName"><i class="@languageInfo.Icon" aria-label="@languageInfo.Icon"></i></span>
            </a>
        }
    </div>
}